<html>
<title>文件上传</title>
	<head>
		<meta charset="utf-8" />
		<style type=text/css>
    body{
        background-image:url(jrjm.jpg) ;
		background-size:cover;
	    background-attachment: fixed;
	    background-repeat:no-repeat;
        color:#ffc0cb;
          }  
          .div2{
            text-align:center;
          }
          ul{
		    width:900px;
            height:700px;
            border:1px solid #ffc0cb;
            box-sizing: border-box;
			list-style-type: none;
			margin-left:25%; 
            text-align:center;
	      }	
          form{
            margin-top:5%; 
          }
    </style>
	</head>
	<body>
    <div class="div2">
	<h1>成凡大学学生信息管理系统</h1>
  </div>
		<ul >
		<form method="post" action="" enctype="multipart/form-data">
        请上传需要的文件：<input type="file" name="myfile">
        <input type="submit" value="上传">
        <input name="Submit2" type="button" class="btn_grey" value="返回" onClick="history.back();"></td>
        </form>
        </ul>
        <?php include("bq.php"); ?>
	</body>
</html>
<?php
if(isset($_FILES['myfile']))
{
    if($_FILES['myfile']['size']<2048000){
        if(is_uploaded_file($_FILES['myfile']['tmp_name']))
        {
        $oldpath=$_FILES['myfile']['tmp_name'];
        $newpath=$_SERVER['DOCUMENT_ROOT']."/xhc/wj/".$_FILES['myfile']['name'];
        if(move_uploaded_file($oldpath,$newpath))
        { echo "<script>alert('上传成功！');</script>" ;
        }
        else
        { echo "<script>alert('上传失败！');</script>";
        }
        } 
    }
    else{
        echo  "<script>alert('文件大小不符合要求！');</script>";
    }
   
}
?>